<%@ include file="lib.jsp"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="/css/admin.css">
<script type="text/javascript" language="javascript" src="/js/ajax.js"></script>
<title>Administrator Category</title>
</head>
<body >
<table border="1" height="100%">
	<tr>
		<td id="left_menu" >
			<%@include file="admin_left.jsp" %>
		</td>
		
		<td id="content" width="100%" valign="top">
			<c:if test="${action ==0}">
				<div id="content_action"><a href="?action=new">Add</a></div>
				<div id="htmldata">
				<table border="1">
				<c:forEach var="data" items="${datalist}">
					<tr>
						<td><c:out value="${data.key}"></c:out></td>
						<td><c:out value="${data.name}"></c:out></td>
						<td><c:out value="${data.name_us}"></c:out></td>
						
						<td><a
							href="JavaScript:ajax('?action=delete&key=${data.key}','htmldata')">Delete
						</a></td>
						<td><a
							href='?action=edit&key=<c:out value="${data.key}"></c:out>'>Edit
						</a></td>
					</tr>
				</c:forEach>
				</table>
				</div>
			</c:if>
			<c:if test="${action ==1}"><%@include file="admin_category_form.jsp" %></c:if>
			<c:if test="${action ==2}"><%@include file="admin_category_form.jsp" %></c:if>
		
		</td>
	</tr>
</table>
</body>
</html>